<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:82:"/data/wwwroot/go.iamcoder.club/public/../application/admin/view/casee/content.html";i:1512715614;}*/ ?>
	<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="__STATIC__/css/wangEditor.min.css">
    <script src="__STATIC__/js/jquery-1.8.3.min.js"></script>
    <script src="__STATIC__/js/wangEditor.min.js"></script>
    <style type="text/css">
        .toolbar{ border: 1px solid #ccc;}.text{min-height: 400px;}
        .up_btn{float: right;width: 70px;border: 1px solid #ccc;height: 30px;text-align: center;line-height: 30px;margin-top: 10px;border-radius: 3px;font-size: 14px;}
    </style>
</head>
<body>
    <div>
        <br><br>
        请选择案例所属类型:
    
        <select name="" id="server">
            <?php 
                foreach ($server as $key => $v) {
            ?>
                 <option value="<?php echo $v['cn']; ?>" <?php if($v['cn'] == $type){echo 'selected';} ?>><?php echo $v['cn']; ?></option>
            <?php
                }
            ?>
        </select>
    </div>
    <br><br>
    <div id="div2" class="text"><?php echo $data; ?></div>
    <buttom class="up_btn">确认修改</buttom>
    <script type="text/javascript">
    	var obj = new wangEditor('div2');
    	var id = '<?php echo $id; ?>';
        obj.config.menus  = ['forecolor','bold','underline','italic','strikethrough','|','fontfamily','fontsize','head','unorderlist','orderlist','alignleft','aligncenter','alignright','|','link','unlink','table','emotion','|','img','video'];
        obj.config.colors = {'#800080': '紫色','#ff0000': '红色','#ff00ff': '鲜粉色','#000080': '深蓝色','#0000ff': '蓝色','#49CAE1': '湖蓝色','#008080': '蓝绿色','#008000': '绿色','#808000': '橄榄色','#00ff00': '浅绿色','#ffcc00': '橙黄色','#808080': '灰色','#c0c0c0':'银色','#000000':'黑色','#ffffff':'白色'};
        obj.config.uploadImgUrl = '<?php echo url('admin/casee/uploads'); ?>';
        obj.config.hideLinkImg = true;
        obj.create();
        $(".up_btn").click(function(){
        	var content = $(".text").html();
            var server = $('#server').val();
        	$.post('<?php echo url('admin/casee/editcasee'); ?>',{'id':id,'content':content,'type':server},function(msg){
	            console.log(msg);
	          if(msg ==200){
	         	  $(".layui-layer-shade", window.parent.document).hide();
        	      $(".layui-layer", window.parent.document).hide();
//      	      history.go(0);
        	      parent.location.reload();
	          }
       		});
        });
    </script>
</body>
</html>